﻿using System.Collections.Generic;
using System.Linq;

using Odebrecht.WcfService.Entities;
using Odebrecht.WcfService.ServiceContracts;

namespace Odebrecht.WcfService.Services
{
    public class TarefaService : ITarefaService
    {
        #region Methods

        public IEnumerable<Tarefa> GetTarefas()
        {
            IList<Tarefa> result;

            using (var context = new DatabaseContext())
            {
                result = context.Tarefa
                  .OrderBy(c => c.Nome)
                  .ToList();
            }

            return result;
        }

        #endregion Methods
    }
}